import request from '../utils/request'

/*评价接口*/

/**
 * 获取评价
 * @returns {AxiosPromise}
 */
export function getEvaluate() {
  return request({
    url:'/evaluate?action=',
    method:'get'
  })
}
/**
 * 获取评价详情
 * @returns {AxiosPromise}
 */
export function getEvaluateByParams(params) {
  return request({
    url:`/evaluate/${params.id}?equipment_id=${params.equipment_id}`,
    method:'get',
  })
}

/**
 * 根据id获取评价
 * @returns {AxiosPromise}
 */
export function getEvaluateById(id) {
  return request({
    url:`/evaluate/${id}`,
    method:'get',
  })
}


/**
 * 处理评价
 * @param data
 * @returns {AxiosPromise}
 */
export function handlingComplaintsEvaluate(data) {
  return request({
    url:'/evaluate',
    method:'post',
    params:data
  })
}

/**
 * 处理评价
 * @param data
 * @returns {AxiosPromise}
 */
export function deleteEvaluateById(id) {
  return request({
    url:`/evaluate/${id}`,
    method:'delete',
  })
}



/**
 * 更新状态
 * @param data
 * @returns {AxiosPromise}
 */
export function updateStatus(id) {
  return request({
    url: `/evaluate/${id}`,
    method:'put',
  })
}

